mod test;

pub use test::test_fibonacci;

#[macro_export]
macro_rules! my_vec {

    () => {Vec::new()};
    ($elem:expr ; $n:expr) =>{std::vec::from_elem($elem,$n)};
    // * 是 0 到多次  + 是1次到多次
    ($($x: expr),+ $(,)?) => {
        {
            let mut temp_vec = Vec::new();
            $(
                temp_vec.push($x);
            )*
            temp_vec
        }
        
    };

    // ($($x:expr),+ $(,)?) => (
    //     <[_]>::into_vec(
    //         // Using the intrinsic produces a dramatic improvement in stack usage for
    //         // unoptimized programs using this code path to construct large Vecs.
    //      //   <[_]>::into_vec(Box::new([$($x),+]))
    //         //$crate::boxed::box_new([$($x),+])
    //     )
    // );

}
    // ? operator. How to simulate it
    #[macro_export]
    macro_rules! my_try {
        ($expr: expr) => {
            match $expr {
                Ok(val) => val,
                Err(err) => return Err(err.into()),
            }
        };
    }


    // my_ready! => Poll::Ready  } Poll::Pending
    #[macro_export]
    macro_rules! my_ready{
        ($expr: expr) => {
            match $expr{
                std::task::Poll::Ready(v) => return std::task::Poll::Ready(v),
                std::task::Poll::Pending => return std::task::Poll::Pending,
            }
        };
    }


